<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <base href="<%=basePath%>">
    <title>社团列表</title>
    <link rel="icon" href="../images/NPU.png">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="application/x-javascript">addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false);
    function hideURLbar(){ window.scrollTo(0,1); }</script>
    <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" />
    <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
    <link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Viga' rel='stylesheet' type='text/css'>
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <style>
        /* 保持导航栏在顶部 */
        .navbar-wrapper {
            position: static;
        }
        .navbar-static-top {
            margin-bottom: 0;
        }
        /* 列表内容样式 */
        .list-container {
            padding: 40px 15px;
            min-height: 60vh; /* 保证最小高度，使页脚不会太靠上 */
        }

        .pagination-container {
            text-align: center;
            margin: 20px 0;
            font-size: 14px;
        }
        .pagination-container a {
            margin: 0 6px;
            text-decoration: none;
            color: #000000; /* 默认黑色 */
            transition: color 0.2s ease;
        }
        .pagination-container a:hover {
            color: #337ab7; /* 鼠标悬停变为蓝色 */
        }

        .table-responsive tbody a {
            color: #000000; /* 表格内容链接为黑色 */
        }

        .table-responsive tbody a:hover {
            color: #337ab7; /* 鼠标悬停变为蓝色 */
        }

    </style>
</head>
<body>
<section class="top-bar">
    <div class="container">
        <div class="row">
            <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
                <a href="index2.jsp" class="logo"><h1>西北工业大学校园社团管理系统</h1></a>
            </div>
        </div>
    </div>
</section>

<div class="navbar-wrapper">
    <div class="container">
        <nav class="navbar navbar-inverse navbar-static-top cl-effect-21">
            <div class="container">
                <div class="navbar-header">
                </div>
                <div id="navbar" class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                    </ul>
                </div>
            </div>
        </nav>
    </div>
</div>

<section class="list-container">
    <div class="container">
        <h3 class="text-center">社团列表</h3>
        <hr>
        <div class="table-responsive">
            <table class="table table-striped table-hover">
                <thead>
                <tr>
                    <th>社团名称</th>
                    <th>创建者</th>
                    <th>创建时间</th>
                    <th>人数</th>
                    <th>社团范围</th>
                    <th>社团类别</th>
                    <th>社团主页</th>
                </tr>
                </thead>
                <tbody>
                <c:if test="${empty Community}">
                    <tr>
                        <td colspan="7" class="text-center">暂无社团信息</td>
                    </tr>
                </c:if>
                <c:forEach var="com" items="${Community}">
                    <tr>
                        <td>${com.communityName}</td>
                        <td>${com.communityCreaterName}</td>
                        <td>${com.communityCreateDate}</td>
                        <td>${com.communityNum}</td>
                        <td>${com.communityRange}</td>
                        <td>${com.communityClassName}</td>
                        <td><a href="info/community_info.jsp">查看主页</a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>

        <!-- 分页区域：把你提供的功能逻辑插在这里（保留原 JSTL 判断与链接） -->
        <div class="pagination-container">
            <span>共有${page.itemCont} 条记录，当前${page.pageCurrent}/${page.pageCont}页分页</span>
            &nbsp; &nbsp; &nbsp;
            <c:choose>
                <c:when test="${page.pageCurrent==1 }">
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCurrent }">首页</a>
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCurrent }">上一页</a>
                </c:when>
                <c:otherwise>
                    <a href="admin/Query?lru=clist2&cpage=1">首页</a>
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCurrent-1}">上一页</a>
                </c:otherwise>
            </c:choose>

            <c:choose>
                <c:when test="${page.pageCurrent==page.pageCont }">
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCurrent }">下一页</a>
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCurrent }">尾页</a>
                </c:when>
                <c:otherwise>
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCurrent+1}">下一页</a>
                    <a href="admin/Query?lru=clist2&cpage=${page.pageCont}">尾页</a>
                </c:otherwise>
            </c:choose>
        </div>
        <!-- 分页区域结束 -->

    </div>
</section>

<section class="footer">
    <h2 class="text-center">感谢您浏览本页面</h2>
    <p>
        <a href="https://www.nwpu.edu.cn/" target="_blank">西北工业大学官网</a>|
        <a href="https://ecampus.nwpu.edu.cn/main.html#/Index" target="_blank">翱翔门户</a>|
        <a href="https://gs.nwpu.edu.cn/" target="_blank">西北工业大学研究生院</a>
    </p><br>
    <p></p>
</section>

<a href="#0" class="cd-top">Top</a>
<script src="js/backtotop.js"></script>
<script src="js/SmoothScroll.min.js"></script>
</body>
</html>
